package com.jeespring.order;

import com.jeespring.rule.CustomizeRule;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableEurekaClient
@RibbonClient(name = "SPRING-CLOUD-PAY",configuration = CustomizeRule.class)
public class EurekaOrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(EurekaOrderApplication.class, args);
    }

    @Bean("RestTemplate")
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

    @Bean("LBRestTemplate")
    @LoadBalanced
    public RestTemplate getLBRestTemplate(){
        return new RestTemplate();
    }
}
